﻿@model Dyd.BaseService.ConfigManager.Domain.Model.tb_systemconfig_model

@{
    ViewBag.Title = "编辑系统配置";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="head">
    <div class="top">
        <h3 class="fl">@ViewBag.Title</h3>
        <a href="javascript:void(0);" class="back fr">返回</a>
    </div>
</div>
<div>
    @using (Html.BeginForm("SystemConfigEdit", "Config"))
    {
        @Html.AntiForgeryToken()
        @Html.HiddenFor(model => model.id)
        <ul class="mydetail">
            <li>
                @Html.LabelFor(model => model.key)
                @Html.EditorFor(model => model.key)
                @Html.ValidationMessageFor(model => model.key)
            </li>
            <li>
                @Html.LabelFor(model => model.value)
                @Html.EditorFor(model => model.value)
                @Html.ValidationMessageFor(model => model.value)
            </li>
            <li>
                @Html.LabelFor(model => model.remark)
                @Html.TextAreaFor(model => model.remark)
                @Html.ValidationMessageFor(model => model.remark)
            </li>
            <li>
                <input id="save" type="button" class="btn1" value="提交" />
                @Html.ValidationMessage("Error")
            </li>
        </ul>
    }
</div>
@section Scripts{
    <script>
        $(function () {

            $("#save").click(function () {
                var submitJson = $("form").serialize();
                $.ajax({
                    url: "/SystemConfig/SystemConfigEdit",
                    data: addAntiForgeryToken(submitJson),
                    type: "post",
                    success: function (data) {
                        if (data.Flag) {
                            alert(data.Message);
                            window.location.href = "/SystemConfig/SystemConfigIndex";
                        } else {
                            alert(data.Message);
                        }
                    }
                });
            });
        });

    </script>
}